home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 148 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.2 KB

  1. Path: unsw.edu.au!gwong
  2. From: gwong@cse.unsw.edu.au (Geoffrey  Wong)
  3. Newsgroups: comp.std.c
  4. Subject: memcpy
  5. Date: 19 Jan 1996 02:43:42 GMT
  6. Organization: University of New South Wales
  7. Message-ID: <4dn0gu$itc@mirv.unsw.edu.au>
  8. NNTP-Posting-Host: thesis.circus.cse.unsw.edu.au
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Can memcpy cope with very complex objects?
  12.  
  13. How about the following one:-
  14. >struct _rlgg_rec        
  15. >{                       
  16. >    SLiteral    head;   
  17. >    SLiteral    *body;  
  18. >    int         size;   
  19. >};                      
  20.                         
  21.  
  22. and...
  23.  
  24.  
  25. >struct _slit_rec                                                            
  26. >{                                                                           
  27. >       char            Sign;           /* 0=negated, 1=pos, 2=determinate */           
  28. >       Relation        Rel;                                                        
  29. >       Const           *Constants; /* During an rlgg process Constant and Var is   
  30. >                                   coded using the same data type. This is     
  31. >                                   possible since Const is larger than Var! */ 
  32. >       Which           *ConstVar;      /* 0=const, 1=Var  for each Constants */        
  33. >       int             WeakLits;       /* value up to this literal */                      
  34. >       Ordering        *ArgOrders,     /* recursive lits: =, <, >, # */                
  35. >                       *SaveArgOrders; /* copy during pruning */                       
  36. >       float           Bits;           /* encoding length */                           
  37. >};                                                                          
  38.                                                                             
  39. >typedef struct _slit_rec       *SLiteral,      /* Used in rlgg */   
  40. >                               **SClause;      /* Allowing for const in         
  41.                                                    Literal */                       
  42. if I have some thing with the type struc _rlgg_rec can I just memcpy them?
  43. or do I need to assign each item at a time?
  44.  
  45. If I can memcpy then do I need to allocate space for the destination variable
  46. of type _rlgg_rec with malloc before I memcpy?
  47.  
  48. How do I do that?
  49.  
  50. Geoff
  51. .
  52.  
  53.